/
PackageEditorBase.cs
102 lines (87 loc) · 2.63 KB
/
PackageEditorBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.Installer.Packages
{
using System;
using DotNetNuke.Common.Utilities;
using DotNetNuke.UI.Modules;
/// <summary>The PackageEditorBase class provides a Base Classs for Package Editors.</summary>
public class PackageEditorBase : ModuleUserControlBase, IPackageEditor
{
private bool isWizard = Null.NullBoolean;
private PackageInfo package;
private int packageID = Null.NullInteger;
/// <summary>Gets or sets the Package ID.</summary>
/// <value>An Integer.</value>
public int PackageID
{
get
{
return this.packageID;
}
set
{
this.packageID = value;
}
}
/// <summary>Gets or sets a value indicating whether the Editor is in the Wizard.</summary>
/// <value>An Boolean.</value>
public bool IsWizard
{
get
{
return this.isWizard;
}
set
{
this.isWizard = value;
}
}
protected string DisplayMode => (this.Request.QueryString["Display"] ?? string.Empty).ToLowerInvariant();
protected virtual string EditorID
{
get
{
return Null.NullString;
}
}
protected bool IsSuperTab
{
get
{
return this.ModuleContext.PortalSettings.ActiveTab.IsSuperTab;
}
}
protected PackageInfo Package
{
get
{
if (this.package == null)
{
this.package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, (p) => p.PackageID == this.PackageID);
}
return this.package;
}
}
/// <summary>Used to Initialize the Control.</summary>
public virtual void Initialize()
{
}
/// <summary>Used to Update the Package.</summary>
public virtual void UpdatePackage()
{
}
/// <inheritdoc/>
protected override void OnInit(EventArgs e)
{
this.ID = this.EditorID;
base.OnInit(e);
}
/// <inheritdoc/>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
}
}